<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<?php 

include "includes/headers.php"; 
//include "jerimum/classes/bd.php";
include "jerimum/classes/lances.php";
$_classLance	= new lances();

?>

<body>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  
  var currentPosition = 0;
  var slideWidth = 990;
  var slides = $('.slide');
  var numberOfSlides = slides.length;

  // Remove scrollbar in JS
  $('#slidesContainer').css('overflow', 'hidden');

  // Wrap all .slides with #slideInner div
  slides
    .wrapAll('<div id="slideInner"></div>')
    // Float left to display horizontally, readjust .slides width
	.css({
      'float' : 'left',
      'width' : slideWidth
    });

  // Set #slideInner width equal to total width of all slides
  $('#slideInner').css('width', slideWidth * numberOfSlides);

  // Insert controls in the DOM
  $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

  // Hide left arrow control on first load
  manageControls(currentPosition);

  // Create event listeners for .controls clicks
  $('.control')
    .bind('click', function(){
    // Determine new position
	currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
    
	// Hide / show controls
    manageControls(currentPosition);
    // Move slideInner using margin-left
    $('#slideInner').animate({
      'marginLeft' : slideWidth*(-currentPosition)
    });
  });

  // manageControls: Hides and Shows controls depending on currentPosition
  function manageControls(position){
    // Hide left arrow if position is first slide
	if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
	// Hide right arrow if position is last slide
    if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  }	

});
</script>
	
<!--COMECAO DO TOPO-->
<?php include "includes/header.php"; ?>
<!--FIMZAO DO TOPO-->



<div id="central">

<?php include "includes/busca.php"; ?>

<style type="text/css">
#classificadosLink a{ color:#666; text-decoration:none}
#classificadosLink a:hover{ color:#FF0000; text-decoration:underline}
</style>   
    
    

<div style="clear:both; height:5px">&nbsp;</div>
<!--MENU ESPACAMENTO-->



<!--  Inicio Conteudo -->

<?php 

	//inicia verificando se procedimento � de ativacao de codigo
	$activationCode = htmlentities($_GET["activationCode"]);
	
	if($activationCode != ""){
						
		//verificando codigo
		//prevenir sql injection
		$idLanceCliente = "";
		$sql= mysql_query("select * from clientes_lance where codigo_ativacao = '".$activationCode."'");

		while($row = mysql_fetch_array($sql)){
			$idLanceCliente = $row["id"];
		}	
		
		if($idLanceCliente != "" ){

			//$idLanceCliente = $row["id"];
					$sql= mysql_query("UPDATE clientes_lance SET 
						       ativo='1' where id='".$idLanceCliente."'");	
						
					$com_sucesso = false;
						if($sql == true){
							$com_sucesso =  true;
						}else{
							$com_sucesso =  $com_sucesso;
						}	

						if($com_sucesso){
								
								?>
								
								<ul id="inter-menu">
						   			<li>
						   				<img align="absmiddle" width="24" height="24" src="images/icones/chave.jpg">
						   					<span>A promo&ccedil;&atilde;o para o c&oacute;digo: <?=$activationCode?> foi ativada com sucesso!!</span>
						   	   		</li>
						   	   		
						   	   		<li>
						   				
						   					<span>Confira abaixo as promo&ccedil;&otilde;es imperd&iacute;veis dos nossos parceiros.</span><br/><br/>
						   					<div style="text-align:center;"> 
												<embed width="720" height="480" allowscriptaccess="never" type="application/x-shockwave-flash" bgcolor="#" swliveconnect="TRUE" wmode="opaque" quality="high" flashvars="clickTag=http%3A%2F%2Fad-g.doubleclick.net%2Fclick%253Bh%253Dv8%2F3b42%2F3%2F0%2F%252a%2Fx%253B242207374%253B1-0%253B0%253B40914412%253B11415-720%2F480%253B43043269%2F43061056%2F1%253B%253B%257Eokv%253D%253Bsz%253D720x480%253Bbsg%253D104611%253Bbsg%253D104612%253Bbsg%253D104613%253Bbsg%253D104614%253Bbsg%253D104615%253Bbsg%253D104616%253Bbsg%253D104619%253Bbsg%253D106390%253Bbsg%253D110924%253B%257Eaopt%253D2%2F1%2Fff%2F0%253B%257Esscs%253D%253fhttp%3A%2F%2Fwww.netshoes.com.br%2Fartigos-esportivos%2Fnike%2520air%2520max%2520torch%25206%2520sl%3Fcampaign%3Dc*me_t*oklg_ct*tnn1_m*nka1%26utm_source%3Dorkut_logout%26utm_medium%3D720x480%26utm_campaign%3Dme_orkt-_-lgout_-_-720x480-_-_prod_me_nike_nike-air-max-torch-6-sl-sohoje-19990FG___110712" src="http://s0.2mdn.net/2404988/Or_Logour_Netshoes_Nike_Empilhadeira_11Julho2011.swf">
											</div>
						   					
						   	   		</li>
						
						 		</ul>
								<?php 
						}else{
							
								?>
								
								<ul id="inter-menu">
						   			<li>
						   				<img align="absmiddle" width="24" height="24" src="images/icones/chave.jpg">
						   					<span>Ops..Erro ao ativar a promo&ccedil;&atilde;o para o c&oacute;digo: <?=$activationCode?>..contacte o suporte!!</span>
						   	   		</li>
						
						 		</ul>
								<?php 
							
						}

					
		}else{
				   ?>
					
					<ul id="inter-menu">
			   			<li>
			   				<img align="absmiddle" width="24" height="24" src="images/icones/chave.jpg">
			   					<span>..Ops!!..C&oacute;digo de ativa&ccedil;&atilde;o da promo&ccedil;&atilde;o inv&aacute;lido, porfavor tente novamente!!**</span>
			   	   		</li>
			
			 		</ul>
					<?php 
		}

	}else{
		
		//prossegue para solicitacao de lance
			    $id_lance = htmlentities($_GET["id"]);
	
				if($id_lance == ""){
					
					?>
					
					<ul id="inter-menu">
			   			<li>
			   				<img align="absmiddle" width="24" height="24" src="images/icones/chave.jpg">
			   					<span>Ops..!!..Voc&ecirc; deve primeiramente selecionar uma promo&ccedil;&atilde;o na nossa home-page!!.</span>
			   	   		</li>
			
			 		</ul>
					<?php 
						}else{
			
					?>
								
								<ul id="inter-menu">
								   		<li>
								   			<img align="absmiddle" width="24" height="24" src="images/icones/chave.jpg">
								   					<a onclick="javascript:abreintegracao('promocao','<?=$id_lance?>');" href="javascript:void(0);">Efetue aqui gratuitamente um lance para esta promoção - e receba o seu código de Ativação!!</a>
								   	   </li>
								
								 </ul>
								   
								
								
								<!-- Fim do  Conteudo -->
			
			<?php
					
				}
 }
?>
	


<div style="clear:both">&nbsp;</div>
<?php include "includes/rodape.php"; ?>



</body>
</html>